/***Main function. Link to the other functions
    Copyright (C) 2012  Davide Moriello

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>. 
	
	Contact me for help or more info: davidemo89@gmail.com       ****/


#include <windows.h>
#include <fstream>
#include <iostream>
#include <cstring>
#include "settings.h"
#include "botlife.h"
void findGameWindow(settings& sett);
using namespace std;

void initLogo();
bool checkIfLoot(HDC& hDC);

int main()
{
    settings sett = NULL;
	botlife life = NULL;

	initLogo();
	initSettings(sett);

	cout << "- Istruction:\n- Run the game -> Options\n";
	cout << "- Hot keys: - Set escape to nexus to " << sett->nexus << "\n";
	cout << "- This macro will send you to nexus when you are in danger\n  It works better with high level character\n\n";	


	if(sett->done)
		cout << "Settings loaded succesfully:" << endl << "Settings:" << endl;				

	cout << " - Go to Nexus hotkey to:\" " << sett->nexus << " \"" << endl;
	cout << " - Go to Nexus when your life si under:\" " << sett->lifebeforeteleport << "%\"" << endl;
	if(sett->preventionTeleport)
		cout << " - Preventive teleport is activated" << endl;
	else
		cout << " - Preventive teleport is deactivated" << endl;
	if(!sett->lifebeforesoundalert)
		cout << " - Play Sound alarm deactivated" << endl;
	else
		cout << " - Play sound alarm when life is under: \" " << sett->lifebeforesoundalert << "%\"" << endl;

	cout << "\n - Do you have more then 10 stars?\n - - Please send me a screenshot. You must be in the Nexus.\n - - This will help me fix a stupid teleport bug. THX" << endl;


	findGameWindow(sett); //This starts all the chaos. And btw I hate names!
    

	system("pause>nul");
	return 0;
}



//bool checkIfLoot(HDC& hDC)
//{
//	HDC hDC;
//}

void initLogo()
{
	cout << "******                  ********** **        **         " << endl;
	cout << "/*////**   **   **      /////**/// //        //         " << endl; 
	cout << "/*   /**  //** **           /**     ** ****** **  ****** " << endl;
	cout << "/******    //***            /**    /**////** /** **////**" << endl;
	cout << "/*//// **   /**             /**    /**   **  /**/**   /**" << endl;
	cout << "/*    /**   **              /**    /**  **   /**/**   /**" << endl;
	cout << "/*******   **               /**    /** ******/**//****** " << endl;
	cout << "///////   //                //     // ////// //  //////  " << endl;
	cout << "v. 0.3.0 beta" << endl;
	cout << "Use at your own risk\n";
	cout << "contact: davidemo89@gmail.com for bug reports or feedback or visit\nwww.realmofthemadescape.com" << endl;
	cout << endl;
}
